package com.作业.Day2;




import java.util.Scanner;


public class Homework7 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int sum1 = 0;//小于等于30的人
        int all1 = 0;//小于30的年龄合
        int sum2 = 0;//大于30的人
        int all2 = 0;//大于30的年龄合
        for (int i = 1; i <= 10; i++) {
            System.out.print("请输入第" + i + "位" + "顾客的年龄:");
            int age = scanner.nextInt();
            if (age <= 30) {
                sum1 += 1;
                all1 += age;

            }
            else{
                sum2 += 1;

                all2 += age;

            }

        }
        double a1=all1/sum1;
        double a2=all2/sum2;
        System.out.println("30岁以下的比例是:"+a1);
        System.out.println("30岁以上的比例是:"+a2);
    }
}
